package top.hymsk.ecommerce.pojo.status;

/**
 * @author 花于陌上开
 */
public enum ResponseStatusCode {
    /*响应成功*/
    SUCCESSFUL(0, "请求成功"),
    FAIL(-1, "未完成"),
    /*请求失败：未知原因错误*/
    UNKNOWN_ERROR(100, "未知错误"),
    /*请求失败：权限*/
    USER_OR_AUTHENTICATION_ERROR(200, "用户或权限错误"),
    NO_LOGIN(201, "用户未登录"),
    ACCOUNT_AND_PASSWORD_NOT_MATCH(202, "账号密码不匹配"),
    AUTHENTICATION_FAILURE(203, "用户鉴权失败"),
    PERMISSION_ERROR(204, "权限错误"),
    NO_ACCESS(205, "权限不足"),
    USER_NOT_EXIST(206, "用户不存在"),
    USER_IS_EXIST(207, "用户已存在"),
    USER_HAS_STORE(208, "用户已有店铺"),
    STORE_IS_EXIST(209, "店铺已存在"),

    /*请求失败：请求有误*/
    REQUEST_ERROR(300, "请求参数错误"),
    PARAMETER_INPUT_ERROR(301, "请求参数输入错误"),
    MISSING_PARAMETER(302, "请求缺少参数"),
    REQUESTS_TOO_FREQUENT(303, "请求过于频繁"),
    REQUEST_RESTRICTED(304, "请求受到限制"),
    NO_CORRESPONDING_RESULT(305, "没有对应结果"),
    ILLEGAL_REQUEST(306, "非法请求"),
    STATUS_ERROR(307,"状态错误"),

    /*请求失败：服务错误*/
    SERVER_ERROR(400, "服务器错误"),
    DATABASE_ERROR(401, "数据库错误"),
    EMAIL_CLIENT_SEND_FAILED(402, "邮箱客户端发送失败"),
    MESSAGE_CLIENT_SEND_FAILED(403, "短信客户端发送失败"),
    ES_CLIENT_FAILED(404, "搜索引擎客户端错误"),
    FILE_SYSTEM_FAILED(405,"文件系统错误"),
    /*请求失败：验证错误*/
    VERIFICATION_ERROR(500, "验证错误"),
    VERIFICATION_FAILED(501, "验证失败"),
    VERIFICATION_CODE_EXPIRED_OR_NOT_EXIST(502, "验证码过期或不存在"),
    EXCESSIVE_VERIFICATION(503, "验证次数过多"),
    ;

    private final int statusCode;
    private final String description;

    ResponseStatusCode(int statusCode, String description) {
        this.statusCode = statusCode;
        this.description = description;
    }

    public int getStatusCode() {
        return this.statusCode;
    }

    public String getDescription() {
        return this.description;
    }
}
